package com.pig4cloud.pig.model.controller;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.security.annotation.Inner;
import com.pig4cloud.pig.model.api.dto.ManagementDto;
import com.pig4cloud.pig.model.service.ProxyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;

/**
 * packageName com.pig4cloud.pig.model.controller
 *
 * @author marco
 * @className ProxyController (此处以class为例)
 * @date 2024/6/13
 * @description TODO
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/proxy" )
@Tag(description = "proxy" , name = "接口代理请求" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ModelController {
	private final ProxyService proxyService;
	/**
	 * 测试模型
	 * @throws Exception
	 */
	@Inner(value = false)
	@Operation(summary = "测试模型" , description = "测试模型" )
	@PostMapping(value = "/test")
	public String test(@RequestBody ManagementDto managementDto){
		return  proxyService.test(managementDto);
	}

}
